<!DOCTYPE html>
 <html>
 <head>
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 <% include("/WEB-INF/view/console/common/css.html"){}	%>
 <% include("/WEB-INF/view/console/common/js.html"){} 	%>
 <title></title>
 </head>
 <body> <nav class="navbar navbar-default navbar-fixed-top site-navbar" >
  <div class="navbar-header">
 <a class="navbar-brand" href="#">sysFile</a>
 </div>
  </nav>
 <form name="sysFile_form"  id="sysFile_form" class="form-horizontal" style="margin-top: 60px;">
   <div class="form-group" >
 <label class="col-sm-2 control-label">文件名称</label>
 <div class="col-sm-6">
 <input  type="text"  name="fileName" id="fileName" class="form-control" check-type="required" value='${sysFile.fileName!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">文件类型</label>
 <div class="col-sm-6">
 <input  type="text"  name="fileType" id="fileType" class="form-control" check-type="required" value='${sysFile.fileType!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">文件高度</label>
 <div class="col-sm-6">
 <input  type="text"  name="fileHeight" id="fileHeight" class="form-control" check-type="required" value='${sysFile.fileHeight!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">文件宽度</label>
 <div class="col-sm-6">
 <input  type="text"  name="fileWidth" id="fileWidth" class="form-control" check-type="required" value='${sysFile.fileWidth!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">文件大小</label>
 <div class="col-sm-6">
 <input  type="text"  name="fileSize" id="fileSize" class="form-control" check-type="required" value='${sysFile.fileSize!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">文件地址</label>
 <div class="col-sm-6">
 <input  type="text"  name="fileUrl" id="fileUrl" class="form-control" check-type="required" value='${sysFile.fileUrl!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">是否上传到本地</label>
 <div class="col-sm-6">
 <label><input checked='checked' auto_name='sysFile_local' type="radio"  name="local" value="1"/>本地</label>
 <label><input  auto_name='sysFile_local' type="radio"  name="local" value="2"/>图片服务器</label>
  
 </div>
  </div>
 	<script type="text/javascript">
       $(function($){
       $('input[auto_name="sysFile_local"]').each(function(){
       if('${sysFile.local!}'==this.value){ 
             $(this).attr('checked','checked');
            }
           });
 	    });
 	</script> 
 
   <input type='hidden' name='fileId' id='fileId' value='${sysFile.fileId!}'><input type='hidden' name='common_token' id='common_token' value='${common_token!}'>
 <div class="form-group" style="margin-bottom: 60px;"></div>
 </form>
 <script type="text/javascript">
 $(function($) {
    /*开启表单验证*/
 	$("#sysFile_form").validation();
 });
 /*保存*/
 function saveZqForm(){
    if ($("#sysFile_form").valid() == false) {
 	    return false;
    }
    var formObject=new Object();
    formObject.fileName=$('#fileName').val()==''?null:$('#fileName').val(); 
 formObject.fileType=$('#fileType').val()==''?null:$('#fileType').val(); 
 formObject.fileHeight=$('#fileHeight').val()==''?null:$('#fileHeight').val(); 
 formObject.fileWidth=$('#fileWidth').val()==''?null:$('#fileWidth').val(); 
 formObject.fileSize=$('#fileSize').val()==''?null:$('#fileSize').val(); 
 formObject.fileUrl=$('#fileUrl').val()==''?null:$('#fileUrl').val(); 
 formObject.local=($('input[name="local"]:checked').val()==''?null:$('input[name="local"]:checked').val()); 
 formObject.fileId=$('#fileId').val()==''?null:$('#fileId').val(); 
 
    var formObjectJson = JSON.stringify(formObject);
    $.post("${ctxPath}/console/sys_file/save",
     {
           formObjectJson :formObjectJson,
 	   table_name :'sysFile',
 	   common_token :$("#common_token").val()
     }, function(data) {
        $.confirm({
              title: '提示',
              content: data.message,
              autoClose: 'cancelAction|3000',
              escapeKey: 'cancelAction',
              buttons: {
                  cancelAction: {
                      text: '确定',
                      action: function () {
            parent.$("#sysFile").bootstrapTable("refresh");
            parent.art.dialog.get('id-dialog-sysFile').close();
                      }
                  }
              }
 		});
     });
 }
 </script>
 <nav class="navbar navbar-default navbar-fixed-bottom site-navbar" >
 <div class="container" style="padding-top:10px;padding-bottom:10px;">
 <div class="nav navbar-nav navbar-right">
 <a href="#" class="btn btn-success"  onclick='saveZqForm()'>保存 </a>
  </div>
  </div>
  </nav>
 </body>
